This week, I tackle the concept of recursion as it relates to computer science.
Episode 2 - Recursion
JavaScript example of the factorial function:
// Accepts x as an argument
function factorial(x) {
if(x == 1) // This is the base case for if x is 1, do not recurse
return 1;
else
return x*factorial(x-1); // the argument changes and the function called
}
Episode 2 - Recursion
JavaScript example of the factorial function:
// Accepts x as an argument
function factorial(x) {
if(x == 1) // This is the base case for if x is 1, do not recurse
return 1;
else
return x*factorial(x-1); // the argument changes and the function called
}
Recently Spotted:
*crickets*
Cool, I'll DL in the morning.
As a fun exercise google "recursion". It will ask you if you meant, "recursion". If you click on it, it will ask you if you meant, "recursion".
I've never had a problem with understanding recursion. What I'd be interested in (and I'll look this up) is to see who is attributed with assigning a name to the concept etc...
Again, just as you get started they finish, which must mean they are the right length. Also, I understand they have to be short with no other host etc... It's gotta be tougher to talk for 20-30 minutes by yourself without any stimulus.
Believe me on this one, I was finished. I had multiple edit points, and separately recorded sections, as opposed to the first two which were basically just straight through one recording start to finish (so I'm glad if it came out alright). On the time, I wavered between 20 minutes or 30 minutes initially, but went with 20 since I felt I could cover any topic that I'd think worthwhile in that time, while some would need to stretch to fill 30. Like recursion, which was difficult to do 20
And a catalyst for starting these was that despite feeling comfortable on the podcast, I found if I tried to record anything on my own I'd still feel awkward. Figured this would help things along.